Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Printing Extensions and Drivers /
Chapter 3 - Printer Drivers / User Interface and Chooser Support


Defining Desktop Printer Icons for Your Printer Driver

You need to provide six icons for your printer driver: one to represent your driver in the Extensions folder inside of the System folder, and five others to represent different states of the desktop printer. Figure 3-3 shows the six icons for the Apple LaserWriter driver.

QuickDraw GX automatically imposes certain status icons over the desktop printer (DTP) icons to indicate certain conditions to the user. The status icons are described
in the next section.

Figure 3-3 The Apple LaserWriter printer driver icons

QuickDraw GX uses the printer driver icon to represent the driver in the Extensions folder in the System folder. The desktop printer icons are used to represent different states of the driver when the user has made it a desktop printer.

You need to follow certain guidelines when designing your icons:

One strategy for designing your icons is to design your nondefault desktop printer icons with room for the border that is added for their "default" versions. This simplifies your design process and provides the user with icons that have a consistent appearance and are not distorted.

You need to carefully place the network cables in your shared desktop printer icons because of how they appear when the status icons are overlaid on them. The status icons are more noticeable when the cables are up one pixel from the edge and when the "Y" area of the cables are located in the right half of the icon space. The status icons are described in the next section.

The Desktop Printer Status Icons

QuickDraw GX uses the desktop-printer status icons to convey additional printing information to the user. These are stand-alone icons that are imposed on the lower-left quadrant of the desktop printer icons whenever the status of a desktop printer changes. Each of the status icons is designed with unique color characteristics to help visually distinguish them. Figure 3-4 shows the QuickDraw GX desktop-printer status icons.

Figure 3-4 The QuickDraw GX desktop-printer status icons

When a desktop printer is available but not currently being used, the desktop printer icon is displayed without any status added. QuickDraw GX automatically adds the status icon whenever the printer's status changes, as follows:

You provide four desktop printer icons for your printer driver, and QuickDraw GX automatically overlays six different icons on them to convey status information. This means that a desktop printer can be represented on the user's desktop by 28 different icons, as shown in Figure 3-5.

Figure 3-5 Desktop printer icons showing printer status

Bundling Your Printer Driver Icons

You need to create a bundle ('BNDL') resource for your printer driver, just as you do for any Macintosh application program. The bundle resource, which is described in Inside Macintosh: Macintosh Toolbox Essentials, associates your printer driver with its icons and with any files that it creates.

QuickDraw GX needs to map the local IDs of your desktop printer icons (which are described in the previous section) into specific IDs to properly use them. For this to happen, you must define a file reference ('FREF') resource for each type of desktop printer icon that you include with your driver. The file types listed in Table 3-11 must be used as shown.
Table 3-11 File types for desktop printer icons
Icon file typeIcon usage
'dpnn'Nonshared, nondefault desktop printer
'dpcn'Nonshared, default desktop printer
'dpns'Shared, nondefault desktop printer
'dpcs'Shared, default desktop printer
'dvcl'Desktop printer when QuickDraw GX is not active
'dppz'Printer driver in the Extensions folder when QuickDraw GX
is active
'pdvr'Printer driver in the Chooser when QuickDraw GX is active, and printer driver in the Extensions folder when QuickDraw GX is not active

The bundle resource for the ImageWriter II printer driver defines the local ID and file reference IDs for each of the desktop printer icon definitions that follow. The resource definition is shown in Listing 3-31.

Listing 3-31 The bundle resource for the ImageWriter II printer driver

resource 'BNDL' (gxPrintingDriverBaseID + 1, sysHeap, purgeable)
{
   kCreatorType,
   0,
   {
      'ICN#', { 0, gxPrintingDriverBaseID + 2;
                1, gxPrintingDriverBaseID + 3;
                2, gxPrintingDriverBaseID + 4;
                3, gxPrintingDriverBaseID + 5
               },
      'FREF', { 0, gxPrintingDriverBaseID + 2;
                1, gxPrintingDriverBaseID + 3;
                2, gxPrintingDriverBaseID + 4;
                3, gxPrintingDriverBaseID + 5;
                0, gxPrintingDriverBaseID + 1
               }
   }
};
The ImageWriter II printer driver includes a file reference resource for its file type signature and one file reference resource for each type of desktop printer icon, as shown in Listing 3-32.

Listing 3-32 The file reference resources for the ImageWriter II printer driver

resource 'FREF' (gxPrintingDriverBaseID + 1, sysHeap, purgeable) { 
kFileType, 0, "" };
resource 'FREF' (gxPrintingDriverBaseID + 2, sysHeap, purgeable) { 
'dpnn', 0, "" };
resource 'FREF' (gxPrintingDriverBaseID + 3, sysHeap, purgeable) { 
'dpns', 1, "" };
resource 'FREF' (gxPrintingDriverBaseID + 4, sysHeap, purgeable) { 
'dpcn', 2, "" };
resource 'FREF' (gxPrintingDriverBaseID + 5, sysHeap, purgeable) { 
'dpcs', 3, "" };
The ImageWriter II printer driver defines icons in various sizes and resolution for display on the user's desktop. Note that each related icon (the various sizes and resolutions for each purpose) shares the same resource ID. For example, each of the icons used to represent a desktop printer that is shared and default ('dpcs') has resource ID gxPrintingDriverBaseID + 5, as shown in Listing 3-33. The actual data for the icons can be found in the QuickDraw GX sample code.

Listing 3-33 The icon resources for the ImageWriter II printer driver

/* 
   Icons in various sizes and resolutions for the different 
    representations of the desktop printer are included here.
*/
   /* nonshared, nondefault desktop printer icon definitions*/
resource 'ics#' (gxPrintingDriverBaseID + 2, sysHeap, purgeable)
{        /* icon resource goes here */
};
resource 'ics4' (gxPrintingDriverBaseID + 2, sysHeap, purgeable)
{        /* icon resource goes here */
};
resource 'ics8' (gxPrintingDriverBaseID + 2, sysHeap, purgeable)
{        /* icon resource goes here */
};
resource 'ICN#' (gxPrintingDriverBaseID + 2, sysHeap, purgeable)
{        /* icon resource goes here */
};
resource 'icl4' (gxPrintingDriverBaseID + 2, sysHeap, purgeable)
{        /* icon resource goes here */
};
resource 'icl8' (gxPrintingDriverBaseID + 2, sysHeap, purgeable)
{        /* icon resource goes here */
};
   /* nondefault, shared desktop printer icon definitions*/
resource 'ICN#' (gxPrintingDriverBaseID + 3, sysHeap, purgeable)
{        /* icon resource goes here */
};
resource 'icl4' (gxPrintingDriverBaseID + 3, sysHeap, purgeable)
{        /* icon resource goes here */
};
resource 'icl8' (gxPrintingDriverBaseID + 3, sysHeap, purgeable)
{        /* icon resource goes here */
};
   /* default, nonshared desktop printer icons */
resource 'ICN#' (gxPrintingDriverBaseID + 4, sysHeap, purgeable)
{        /* icon resource goes here */
};
resource 'icl4' (gxPrintingDriverBaseID + 4, sysHeap, purgeable)
{        /* icon resource goes here */
};
resource 'icl8' (gxPrintingDriverBaseID + 4, sysHeap, purgeable)
{        /* icon resource goes here */
};
   /* default, shared desktop printer icon definitions*/
resource 'ICN#' (gxPrintingDriverBaseID + 5, sysHeap, purgeable)
{        /* icon resource goes here */
};
resource 'icl4' (gxPrintingDriverBaseID + 5, sysHeap, purgeable)
{        /* icon resource goes here */
};
resource 'icl8' (gxPrintingDriverBaseID + 5, sysHeap, purgeable)
{			/* icon resource goes here */
};

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help